FROM chenzifan/php:80
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
    && apk --update add --no-cache \
    openssh \
    tzdata \
    boost-dev \
    && sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config \
    && ssh-keygen -t dsa -P "" -f /etc/ssh/ssh_host_dsa_key \
    && ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key \
    && ssh-keygen -t ecdsa -P "" -f /etc/ssh/ssh_host_ecdsa_key \
    && ssh-keygen -t ed25519 -P "" -f /etc/ssh/ssh_host_ed25519_key \
    && echo "root:admin" | chpasswd \
    && rm -rf /var/cache/apk/*
EXPOSE 22 9009 8080
COPY ./conf/yasd.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY ./conf/docker-php-ext-yasd.ini /usr/local/etc/php/conf.d/
# 执行ssh启动命令
CMD ["/usr/sbin/sshd", "-D"]